import numpy as np

L = 640000  # 换为cm总长度
inch = L / 2.54  # 以inch为单位
feet = inch / 12  # 以foot为单位
yard = feet / 3  # 以yard为单位
mile = yard / 1730  # 以mile为单位
length = [inch, feet, yard, mile]  # 长度数组
danwei = ["inch", "feet", "yards", "miles"]  # 单位数组
i = 0
while i < len(length):  # 遍历两数组进行打印
    print("640m等于" + "{:.3f}".format(length[i]) + danwei[i])
    i += 1
